<template>
	<view class="page">
		<navHead :datas="headData"></navHead>
		<view class="heit pd-30 ">
			<view class="card pd-20">
				<view class="ft1">{{ "输入您要描述的内容" }}</view>
				<view class="main mt-20 pd-20">
					<textarea v-model="remark" maxlength="-1" auto-height placeholder="请输入"></textarea>
				</view>
			</view>
		</view>
		<view style="height: 166rpx;"></view>
		<view class="btn flex-center">
			<view class="submit flex-center ft act" @click="sub"> 提交</view>
		</view>
	</view>
</template>

<script setup lang="js">
	import {
		onLoad
	} from '@dcloudio/uni-app'
	import {
		ref,
		reactive,
		onMounted,
		getCurrentInstance
	} from "vue";
	import {
		utils
	} from "@/utils/utils.js";
	import {
		api
	} from "@/utils/api.js";
	
	import navHead from '@/components/navHead.vue';
	const headData = reactive({
		color: '#fff',
		title: '备注'
	})
	
	const {
		proxy
	} = getCurrentInstance();

	const remark = ref('')
	onLoad((options) => {
		const eventChannel = proxy.getOpenerEventChannel();
		// 接收数据
		eventChannel.on('toDetail', (data) => {
			remark.value = data.remark
		});
	})

	const sub = () => {
		const eventChannel = proxy.getOpenerEventChannel();
		eventChannel.emit('fromDetail', {
			remark: remark.value
		});
		uni.navigateBack(-1)
	}
</script>

<style lang="scss" scoped>
	.heit {
		// height: 1280rpx;
	}

	.card {
		width: 690rpx;
		background: #F8F8F8;
		border-radius: 40rpx;
	}

	.main {
		width: 650rpx;
		min-height: 400rpx;
		background: #FFFFFF;
		border-radius: 40rpx;
		font-size: 24rpx;
		color: #666666;
	}

	.btn {
		position: fixed;
		z-index: 99;
		bottom: 0;
		left: 0;
		background: #F8F8F8;
		width: 100%;
		padding-top: 10rpx;
		padding-bottom: calc(10rpx + env(safe-area-inset-bottom));
		box-shadow: 0rpx -2rpx 2rpx 2rpx rgba(0, 0, 0, 0.05);

		.submit {
			width: 690rpx;
			height: 78rpx;
			background: #F1F1F1;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
		}

		.act {
			color: #DBF046;
			background: #333333;
		}
	}
</style>